import java.io.InputStream;
import java.util.*;
//HJ1 字符串最后一个单词的长度  牛客
public class Main{
     public  static void  main(String [] args) throws Exception{
        Scanner s = new Scanner(System.in);
        String str = s.nextLine();
         String[] ret = str.split(" ");
         System.out.println(ret[ret.length-1].length());
     }
}


//387. 字符串中的第一个唯一字符
class Solution {
    public int firstUniqChar(String s) {
        int[] count = new int[26];
        char[] ch = s.toCharArray();
        int i = 0;
        for (i = 0;i<s.length();i++){
            count[ch[i]-'a']++;
        }
        for (i=0;i<s.length();i++){
            if ( count[ch[i]-'a'] == 1){
                return i;
            }
        }
        return -1;
    }
}